import { ADDCOLOR, CHANGECOLOR } from './action-types'
export function colorReducer(state, action) {
  console.log("colorReducer", action)
  state = state || {
    color: 'red'
  }
  switch (action.type) {
    case CHANGECOLOR:

      return {
        ...state,
        color: action.col,
      }
    case ADDCOLOR:
      return {
        color: 'blue'
      }
    default:
      return {
        ...state
      }
  }
}